home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form Form1 Caption = "AVI Play" ClientHeight = 825 ClientLeft = 3810 ClientTop = 1785 ClientWidth = 2175 Height = 1230 Icon = AVIPLAY.FRX:0000 Left = 3750 LinkMode = 1 'Source LinkTopic = "Form1" ScaleHeight = 825 ScaleWidth = 2175 Top = 1440 Visible = 0 'False Width = 2295 Declare Function mciSendString Lib "MMSystem" (ByVal lpstrCommand As String, ByVal lpstrReturn As String, ByVal nSize As Integer, ByVal hCallback As Integer) As Long Declare Function mciGetErrorString Lib "MMSystem" (ByVal dwError As Long, ByVal lpstrBuffer As String, ByVal wLength As Integer) As Integer Sub Form_Load () fname$ = Command$ If Len(fname$) < 1 Then End caption = "Playing" i = playit(fname$) End End Sub Function playit (fname$) Dim res1 As String res1 = SendMciCommand$("open " + fname$ + " alias video9 wait") res1 = SendMciCommand$("play video9 wait") res1 = SendMciCommand$("close video9") End Function Function SendMciCommand$ (cmd As String) Dim result As String Dim status As Integer Dim i As Integer result = String$(256, 0) caption = "Send It" status = mciSendString(cmd, result, Len(result), 0) If (status <> 0) Then status = mciGetErrorString(status, result, Len(result)) End If i = InStr(result, Chr$(0)) If i <> 0 Then SendMciCommand$ = Left$(result, i - 1) Else SendMciCommand$ = result End If End Function